package net.oschina.allchat.protocol.core.stream.error;

import net.oschina.allchat.protocol.core.AbstractError;
import net.oschina.allchat.protocol.core.Protocol;

public class StreamError extends AbstractError {
	public static final String NAMESPACE_STREAM_ERROR = "stream";
	public static final Protocol PROTOCOL = new Protocol("error", NAMESPACE_STREAM_ERROR);
	public static final String NAMESPACE_STREAM_ERROR_CONTEXT = "chat:streams";
	public static final Protocol PROTOCOL_ERROR_DEFINED_CONDITION = new Protocol("*", NAMESPACE_STREAM_ERROR_CONTEXT);
	
	public StreamError() {
	}
	
	public StreamError(String definedCondition) {
		super(definedCondition);
	}
	
	// (rfc3290 4.7.1)
	// stream error is always unrecoverable
	@Override
	public boolean closeStream() {
		return true;
	}

}
